package com.glodon.paas.document.storage.directory;

import com.glodon.paas.document.storage.directory.audit.Audit;

public abstract class AbstractDirectory implements Directory {

    private Audit audit;

    public void setAudit(Audit audit) {
        this.audit = audit;
    }

    public Audit getAudit() {
        return audit;
    }

    protected String getKey(String objectId) {
        String folder = objectId.substring(0, 2);
        String name = objectId.substring(2);
        return OBJECT_PREFIX + "/" + folder + "/" + name;
    }

    protected String getPartPath(String id) {
        return PART_PREFIX + "/" + id;
    }
}